<script>
	var url<?=$objectid?>;
	$(document).ready(function(){
	
		newData<?=$objectid?> = function (){
			$('#window<?=$objectid?>').dialog({
				title: ' ',
				width: 350,
				//height: $(window).height() * 0.99,
				height: 200,
				closed: true,
				cache: false,
				href: base_url+'sd/setting/setting_nis/add',
				modal: true,
				style:{background:'#dee5ff'}
			});
			
			$('#window<?=$objectid?>').dialog('open');
			url<?=$objectid?> = base_url+'sd/setting/setting_nis/save/add';
		}
		// end newData
		
		saveData<?=$objectid?> = function(){
			$('#form1<?=$objectid?>').form('submit',{
				url: url<?=$objectid?>,
				onSubmit: function(){
					return $(this).form('validate');
				},
				success: function(result){
					//alert(result);
					var result = eval('('+result+')');
					if (result.success){
						$('#window<?=$objectid?>').dialog('close');		// close the dialog
						$.messager.show({
							title:'Pesan',
							msg: "Data berhasil disimpan...",
							showType:'slide'
						});
					} else {
						ShowMessageError(result.msg);
					}
				}
			});
		}
		//end saveData
		
		newData<?=$objectid?>();
		
	});
</script>

<!-- AREA untuk Form Add/EDIT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>  -->
<div id="window<?=$objectid?>" class="easyui-dialog" style="width:350px;height:150px;padding:10px;" data-options="
		closed:true,
		minimizable:false,
		collapsible:false,
		maximizable:false,
		buttons:[{
					text:'Save',
					iconCls:'icon-ok',
					handler:function(){ saveData<?=$objectid?>(); }
				},{
					text:'Close',
					iconCls:'icon-cancel',
					handler:function(){ $('#window<?=$objectid?>').dialog('close') }
				}],
		onResize:function(){
			$(this).window('center');
		}"
>
</div>